//
//  DoctorViewController.m
//  QuickCure
//
//  Created by 曹魏 on 16/9/15.
//  Copyright © 2016年 haoge. All rights reserved.
//

#import "CWMessageModel.h"
#import "NetWorkTool.h"

@implementation CWMessageModel : NSObject

+ (instancetype)messageModelWithDictionary:(NSDictionary *)dict
{
    CWMessageModel *model = [[CWMessageModel alloc]init];
    [model setValuesForKeysWithDictionary:dict];
    return model;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{};

+ (void)modelWithSuccess:(void(^)(CWMessageModel *model))successBlock
{
    NSDictionary *dict = @{
                           @"doctor_id":@300000315
                           };

    [[NetWorkTool shareManager]POST_RequestWithUrlString:@"http://iosapi.itcast.cn/doctorReceivingSetting.json.php" parmas:dict successBloock:^(NSDictionary *responseObject) {
        
//        NSLog(@"%@",responseObject);

        NSDictionary *dict = responseObject[@"data"];
        
        CWMessageModel *model = [CWMessageModel messageModelWithDictionary:dict];
        [model setValuesForKeysWithDictionary:dict];
        
        if(successBlock)
        {
            successBlock(model);
        }
        
    } failureBlock:^(NSError *error) {
        
    }];
}


@end






